package com.lepisori.voting.contracts;

import java.math.BigInteger;
import java.util.Arrays;
import java.util.Collections;
import org.web3j.abi.TypeReference;
import org.web3j.abi.datatypes.Address;
import org.web3j.abi.datatypes.DynamicArray;
import org.web3j.abi.datatypes.Function;
import org.web3j.abi.datatypes.Type;
import org.web3j.abi.datatypes.Utf8String;
import org.web3j.abi.datatypes.generated.Bytes32;
import org.web3j.abi.datatypes.generated.Uint256;
import org.web3j.crypto.Credentials;
import org.web3j.protocol.Web3j;
import org.web3j.protocol.core.RemoteCall;
import org.web3j.protocol.core.methods.response.TransactionReceipt;
import org.web3j.tx.Contract;
import org.web3j.tx.TransactionManager;
import org.web3j.tx.gas.ContractGasProvider;

/**
 * <p>Auto generated code.
 * <p><strong>Do not modify!</strong>
 * <p>Please use the <a href="https://docs.web3j.io/command_line.html">web3j command line tools</a>,
 * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the 
 * <a href="https://github.com/web3j/web3j/tree/master/codegen">codegen module</a> to update.
 *
 * <p>Generated with web3j version 4.3.0.
 */
public class


BallotCollection extends Contract {
    private static final String BINARY = "608060405234801561001057600080fd5b50611a5f806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630b8710e41461005c5780635c632b38146100c857806367bda04214610135575b600080fd5b34801561006857600080fd5b5061007161026e565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156100b4578082015181840152602081019050610099565b505050509050019250505060405180910390f35b3480156100d457600080fd5b506100f3600480360381019080803590602001909291905050506102fc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561014157600080fd5b5061022c600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001909291908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061033a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b606060008054806020026020016040519081016040528092919081815260200182805480156102f257602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116102a8575b5050505050905090565b60008181548110151561030b57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008085858585610349610593565b80806020018060200185815260200180602001848103845288818151815260200191508051906020019080838360005b83811015610394578082015181840152602081019050610379565b50505050905090810190601f1680156103c15780820380516001836020036101000a031916815260200191505b50848103835287818151815260200191508051906020019060200280838360005b838110156103fd5780820151818401526020810190506103e2565b50505050905001848103825285818151815260200191508051906020019060200280838360005b8381101561043f578082015181840152602081019050610424565b50505050905001975050505050505050604051809103906000f08015801561046b573d6000803e3d6000fd5b5090508073ffffffffffffffffffffffffffffffffffffffff1663a7b49529336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15801561050957600080fd5b505af115801561051d573d6000803e3d6000fd5b5050505080915060008290806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050949350505050565b604051611490806105a48339019056006080604052602060405190810160405280600060ff1681525060099060016200002a929190620001db565b503480156200003857600080fd5b50604051620014903803806200149083398101806040528101908080518201929190602001805182019291906020018051906020019092919080518201929190505050600033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600860006101000a81548160ff0219169083151502179055508460009080519060200190620000f192919062000232565b5083600690805190602001906200010a929190620002b9565b50600090505b8351811015620001a4576005604080519081016040528086848151811015156200013657fe5b906020019060200201516000191681526020016000815250908060018154018082558091505090600182039060005260206000209060020201600090919290919091506000820151816000019060001916905560208201518160010155505050808060010191505062000110565b826002819055508160049080519060200190620001c392919062000311565b50600480549050600381905550505050505062000436565b8280548282559060005260206000209081019282156200021f579160200282015b828111156200021e578251829060ff16905591602001919060010190620001fc565b5b5090506200022e9190620003a0565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200027557805160ff1916838001178555620002a6565b82800160010185558215620002a6579182015b82811115620002a557825182559160200191906001019062000288565b5b509050620002b59190620003a0565b5090565b828054828255906000526020600020908101928215620002fe579160200282015b82811115620002fd578251829060001916905591602001919060010190620002da565b5b5090506200030d9190620003c8565b5090565b8280548282559060005260206000209081019282156200038d579160200282015b828111156200038c5782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509160200191906001019062000332565b5b5090506200039c9190620003f0565b5090565b620003c591905b80821115620003c1576000816000905550600101620003a7565b5090565b90565b620003ed91905b80821115620003e9576000816000905550600101620003cf565b5090565b90565b6200043391905b808211156200042f57600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101620003f7565b5090565b90565b61104a80620004466000396000f3006080604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063013cf08b146100b457806302d947ef1461010457806306fdde0314610151578063370158ea146101e1578063597e1fb51461033f57806387f7b9751461036e578063a7b49529146103c5578063a97b8b4d14610408578063b79757091461041f578063e2ba53f0146104d3578063ef788cd51461053f575b600080fd5b3480156100c057600080fd5b506100df60048036038101908080359060200190929190505050610556565b6040518083600019166000191681526020018281526020019250505060405180910390f35b34801561011057600080fd5b5061014f60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610589565b005b34801561015d57600080fd5b5061016661086e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a657808201518184015260208101905061018b565b50505050905090810190601f1680156101d35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ed57600080fd5b506101f661090c565b60405180806020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001851515151581526020018060200180602001848103845289818151815260200191508051906020019080838360005b8381101561027a57808201518184015260208101905061025f565b50505050905090810190601f1680156102a75780820380516001836020036101000a031916815260200191505b50848103835286818151815260200191508051906020019060200280838360005b838110156102e35780820151818401526020810190506102c8565b50505050905001848103825285818151815260200191508051906020019060200280838360005b8381101561032557808201518184015260208101905061030a565b505050509050019850505050505050505060405180910390f35b34801561034b57600080fd5b50610354610a50565b604051808215151515815260200191505060405180910390f35b34801561037a57600080fd5b50610383610a63565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103d157600080fd5b50610406600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a89565b005b34801561041457600080fd5b5061041d610acd565b005b34801561042b57600080fd5b50610434610bd5565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561047b578082015181840152602081019050610460565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156104bd5780820151818401526020810190506104a2565b5050505090500194505050505060405180910390f35b3480156104df57600080fd5b506104e8610d4c565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561052b578082015181840152602081019050610510565b505050509050019250505060405180910390f35b34801561054b57600080fd5b50610554610e3d565b005b60058181548110151561056557fe5b90600052602060002090600202016000915090508060000154908060010154905082565b600080600860009054906101000a900460ff16151515610611576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f7468652062616c6c6f7420697320616c726561647920636c6f7365642e00000081525060200191505060405180910390fd5b60009150600090505b6004805490508110156106aa578273ffffffffffffffffffffffffffffffffffffffff1660048281548110151561064d57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561069d57600191506106aa565b808060010191505061061a565b81151561071f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f74686520766f74657220697320696c6c656167616c210000000000000000000081525060200191505060405180910390fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156107e1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f416c726561647920766f7465642e00000000000000000000000000000000000081525060200191505060405180910390fd5b6001600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600160058581548110151561084a57fe5b90600052602060002090600202016001016000828254019250508190555050505050565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109045780601f106108d957610100808354040283529160200191610904565b820191906000526020600020905b8154815290600101906020018083116108e757829003601f168201915b505050505081565b606060008060608060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109aa5780601f1061097f576101008083540402835291602001916109aa565b820191906000526020600020905b81548152906001019060200180831161098d57829003601f168201915b50505050509450600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169350600860009054906101000a900460ff1692506109f0610d4c565b91506006805480602002602001604051908101604052809291908181526020018280548015610a4257602002820191906000526020600020905b81546000191681526020019060010190808311610a2a575b505050505090509091929394565b600860009054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610bb8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001807f6f6e6c79207468652063686169726d616e2063616e20636c6f7365207468652081526020017f62616c6c6f742e0000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6001600860006101000a81548160ff021916908315150217905550565b60608060008060008090505b600580549050811015610c975782600582815481101515610bfe57fe5b906000526020600020906002020160000154908060018154018082558091505090600182039060005260206000200160009091929091909150906000191690555081600582815481101515610c4f57fe5b90600052602060002090600202016001015490806001815401808255809150509060018203906000526020600020016000909192909190915055508080600101915050610be1565b828281805480602002602001604051908101604052809291908181526020018280548015610ce857602002820191906000526020600020905b81546000191681526020019060010190808311610cd0575b5050505050915080805480602002602001604051908101604052809291908181526020018280548015610d3a57602002820191906000526020600020905b815481526020019060010190808311610d26575b50505050509050945094505050509091565b6060600080610d59610e3d565b600090505b600980549050811015610de257816005600983815481101515610d7d57fe5b9060005260206000200154815481101515610d9457fe5b90600052602060002090600202016000015490806001815401808255809150509060018203906000526020600020016000909192909190915090600019169055508080600101915050610d5e565b81805480602002602001604051908101604052809291908181526020018280548015610e3157602002820191906000526020600020905b81546000191681526020019060010190808311610e19575b50505050509250505090565b6000806000600981610e4f9190610fcd565b5060009150600090505b600580549050811015610edb576002546003546064600584815481101515610e7d57fe5b90600052602060002090600202016001015402811515610e9957fe5b04101515610ece5760098190806001815401808255809150509060018203906000526020600020016000909192909190915055505b8080600101915050610e59565b60006009805490501415610fc957600090505b600580549050811015610f545781600582815481101515610f0b57fe5b9060005260206000209060020201600101541115610f4757600581815481101515610f3257fe5b90600052602060002090600202016001015491505b8080600101915050610eee565b600090505b600580549050811015610fc85781600582815481101515610f7657fe5b9060005260206000209060020201600101541415610fbb5760098190806001815401808255809150509060018203906000526020600020016000909192909190915055505b8080600101915050610f59565b5b5050565b815481835581811115610ff457818360005260206000209182019101610ff39190610ff9565b5b505050565b61101b91905b80821115611017576000816000905550600101610fff565b5090565b905600a165627a7a7230582011ed10a68884d39f9a8f621290f54a0b43c31e327332f0b1c4dcd386093e9cd60029a165627a7a723058208e10c5ceb9fbc6498bcac9477df9cef0ae838c95cd6b4ca53fe1d4e1b7ac73a20029";

    public static final String FUNC_GETALLBALLOTS = "getAllBallots";

    public static final String FUNC_BALLOTS = "ballots";

    public static final String FUNC_ADDBALLOT = "addBallot";

    @Deprecated
    protected BallotCollection(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
        super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit);
    }

    protected BallotCollection(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
        super(BINARY, contractAddress, web3j, credentials, contractGasProvider);
    }

    @Deprecated
    protected BallotCollection(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit);
    }

    protected BallotCollection(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
    }

    public RemoteCall<DynamicArray<Address>> getAllBallots() {
        final Function function = new Function(FUNC_GETALLBALLOTS, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<DynamicArray<Address>>() {}));
        return executeRemoteCallSingleValueReturn(function);
    }

    public RemoteCall<Address> ballots(Uint256 param0) {
        final Function function = new Function(FUNC_BALLOTS, 
                Arrays.<Type>asList(param0), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
        return executeRemoteCallSingleValueReturn(function);
    }

    public RemoteCall<TransactionReceipt> addBallot(Utf8String name, DynamicArray<Bytes32> _proposals, Uint256 _proportion, DynamicArray<Address> _voters) {
        final Function function = new Function(
                FUNC_ADDBALLOT, 
                Arrays.<Type>asList(name, _proposals, _proportion, _voters), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    @Deprecated
    public static BallotCollection load(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
        return new BallotCollection(contractAddress, web3j, credentials, gasPrice, gasLimit);
    }

    @Deprecated
    public static BallotCollection load(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        return new BallotCollection(contractAddress, web3j, transactionManager, gasPrice, gasLimit);
    }

    public static BallotCollection load(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
        return new BallotCollection(contractAddress, web3j, credentials, contractGasProvider);
    }

    public static BallotCollection load(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        return new BallotCollection(contractAddress, web3j, transactionManager, contractGasProvider);
    }

    public static RemoteCall<BallotCollection> deploy(Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
        return deployRemoteCall(BallotCollection.class, web3j, credentials, contractGasProvider, BINARY, "");
    }

    @Deprecated
    public static RemoteCall<BallotCollection> deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
        return deployRemoteCall(BallotCollection.class, web3j, credentials, gasPrice, gasLimit, BINARY, "");
    }

    public static RemoteCall<BallotCollection> deploy(Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        return deployRemoteCall(BallotCollection.class, web3j, transactionManager, contractGasProvider, BINARY, "");
    }

    @Deprecated
    public static RemoteCall<BallotCollection> deploy(Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        return deployRemoteCall(BallotCollection.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, "");
    }
}
